﻿namespace MvcXRepairAdmin.Services
{
    using System.Collections.Generic;
    using MvcXRepairAdmin.Interfaces;
    using MvcXRepairAdmin.Repository.SQL;
    using XRepair.Models;

    public class OrderService : IOrderService
    {
        private OrderDAO _orderRepository;

        public OrderService()
        {
            _orderRepository = new OrderDAO();
        }

        public IEnumerable<Order> GetAllActiveOrders()
        {
            return _orderRepository.GetAllActiveOrders();
        }

        public bool DeactivateOrderByID(int orderId)
        {
            return _orderRepository.DeactivateOrderByID(orderId);
        }

        public bool AddNewOrder(Order order)
        {
            return _orderRepository.AddNewOrder(order);
        }

        public bool UpdateOrder(Order order)
        {
            return _orderRepository.UpdateOrder(order);
        }
    }
}
